home *** CD-ROM | disk | FTP | other *** search
- Name
-
- EXT_rescale_normal
-
- Name Strings
-
- GL_EXT_rescale_normal
-
- Version
-
- $Date: 1996/04/02 00:08:36 $ $Revision: 1.2 $
-
- Number
-
- 27
-
- Dependencies
-
- None
-
- Overview
-
- When normal rescaling is enabled a new operation is added to the
- transformation of the normal vector into eye coordinates. The normal vector
- is rescaled after it is multiplied by the inverse modelview matrix and
- before it is normalized.
-
- The rescale factor is chosen so that in many cases normal vectors with unit
- length in object coordinates will not need to be normalized as they
- are transformed into eye coordinates.
-
- New Procedures and Functions
-
- None
-
- New Tokens
-
- Accepted by the <cap> parameter of Enable, Disable, and IsEnabled,
- and by the <pname> parameter of GetBooleanv, GetIntegerv, GetFloatv,
- and GetDoublev:
-
- RESCALE_NORMAL_EXT
-
- Additions to Chapter 2 of the 1.0 Specification (OpenGL Operation)
-
- Section 2.9.3
-
- Finally, we consider how the ModelView transformation state affects
- normals. Normals are of interest only in eye coordinates, so the rules
- governing their transformation to other coordinate systems are not
- examined.
-
- Normals sent to the GL may or may not have unit length. If rescaling is
- enabled, then normals specified with the Normal3 command are rescaled after
- transformation by the ModelView Inverse.
-
- If normalization is enabled, then normals specified with the Normal3
- command are normalized after transformation by the model-view inverse
- matrix and after rescaling if rescaling is enabled. Normalization and
- rescaling are controlled with
-
- void Enable( enum target);
-
- and
-
- void Disable( enum target);
-
- with target equal to NORMALIZE or RESCALE_NORMAL. This requires two
- bits of state. The initial state is for normals not to be normalized or
- rescaled.
- .
- .
- .
-
- Therefore, if the modelview matrix is M, then the transformed plane equation
- is
-
- (n_x' n_y' n_z' q') = ((n_x n_y n_z q) * (M^-1)),
-
- the rescaled normal is
-
- (n_x" n_y" n_z") = f * (n_x' n_y' n_z'),
-
- and the fully transformed normal is
-
- 1 (n_x")
- -------------------------------- (n_y") (2.1)
- ____________________________________ (n_z")
- V (n_x")^2 + (n_y")^2 + (n_z")^2
-
- If rescaling is disabled then f is 1, otherwise f may be computed
- as follows:
-
- Let m_ij denote the matrix element in row i and column j of M^-1,
- numbering the topmost row of the matrix as row 1, and the leftmost
- column as column 1. Then let
-
-
- 1
- __________
- f = ________________________________
- V (m_31)^2 + (m_32)^2 + (m_33)^2
-
- An implementation may chose a different algorithm to compute f
- as long as it satisfies the following 2 criteria:
-
- 1) f is a continuous function of the elements of M.
-
- 2) Denote the upper left 3x3 submatrix of M by M3, denote the transpose
- of M3 by M3^T, and denote the identity matrix by Id. Whenever the last row
- of M is (0,0,0,1), and M3 satisfies M3 * M3^T = a^2 * Id, then
- f = 1/|a|.
-
- If normalization is disabled, then the square root in equation 2.1 is
- replaced with 1, otherwise . . . .
-
- Additions to Chapter 3 of the 1.0 Specification (Rasterization)
-
- None
-
- Additions to Chapter 4 of the 1.0 Specification (Per-Fragment Operations and
- the Framebuffer)
-
- None
-
- Additions to Chapter 5 of the 1.0 Specification (Special Functions)
-
- None
-
- Additions to Chapter 6 of the 1.0 Specification (State and State Requests)
-
- None
-
- Additions to the GLX Specification
-
- None
-
- GLX Protocol
-
- None
-
- Errors
-
- None
-
- New State
-
- Get Value Get Command Type Initial Value Attribute
- --------- ----------- ---- ------------- ---------
- RESCALE_NORMAL_EXT IsEnabled B FALSE transform/enable
-
-
- New Implementation Dependent State
-
- None
-